/*
 * ComponentFocus.java
 *
 * Created on June 5, 2007, 4:00 AM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package latihanibatis.ui;

import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import javax.swing.JComponent;

/**
 *
 * @author javamaniac
 */
public class ComponentFocus implements FocusListener {
    
    private final JComponent comp;
    
    /** Creates a new instance of ComponentFocus */
    public ComponentFocus(JComponent prmComp) {
        this.comp = prmComp;
    }

    public void focusGained(FocusEvent e) {
        comp.setBackground(new java.awt.Color(217, 229, 255));
    }

    public void focusLost(FocusEvent e) {
        comp.setBackground(new java.awt.Color(255, 255, 255));
    }
}
